﻿using Sidvall.Collections;

namespace Sidvall.Data
{
	public sealed class FieldItemCollection : System.Collections.ObjectModel.Collection<FieldItem>
	{
		#region Public Members

		#region Add

		public void Add(string fieldName, DataType valueDataType)
		{
			Add(fieldName, valueDataType, ConcurrencyMode.None, false, false);
		}
		public void Add(string fieldName, DataType valueDataType, ConcurrencyMode concurrencyMode, bool isGenerated, bool isPrimaryKey)
		{
			FieldItem item;

			item = new FieldItem()
			{
				FieldName = fieldName,
				ValueDataType = valueDataType,
				ConcurrencyMode = concurrencyMode,
				IsGenerated = isGenerated,
				IsPrimaryKey = isPrimaryKey,
			};
			Add(item);
		}

		#endregion

		#region ToString

		public override string ToString()
		{
			return this.JoinToString(", ");
		}

		#endregion

		#endregion
		#region Constructors

		public FieldItemCollection()
		{
		}

		#endregion
	}
}
